package com.xn.app.muying.adpter;

import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;

import com.xn.app.muying.R;
import com.xn.app.muying.activity.KePuActivity;

import java.util.ArrayList;

/**
 * Created by Administrator on 2016/10/10.
 */
public class HomeAdpter extends BaseAdapter{
    private Context context;
    private LayoutInflater inflater;
    private ArrayList<String> data = new ArrayList();


    public HomeAdpter(Context context,ArrayList<String> data){
     this.context = context;
        this.data = data;
     inflater = LayoutInflater.from(context);
    }
    @Override
    public int getCount() {
        return data.size();
    }

    @Override
    public Object getItem(int i) {
        return data.get(i);
    }

    @Override
    public long getItemId(int i) {
        return i;
    }

    @Override
    public View getView(int position, View view, ViewGroup viewGroup) {
        ViewHolder holder = new ViewHolder();
                    view = inflater.inflate(R.layout.home_fragment_floor_three,null);
                    holder.lv = (ListView) view.findViewById(R.id.home_fragment_floor_three_lv);

                    HomeItemAdpter homeAdapterr =  new HomeItemAdpter(context,data);
                    holder.lv.setAdapter(homeAdapterr);

        return view;
    }

    class ViewHolder{
        ListView lv;
    }
}
